//
//  xmlMore.m
//  SharekerV2
//
//  Created by huang chuyan on 11-11-2.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "xmlMore.h"


@implementation xmlMore

+ (GDataXMLElement *)GetNodeElement:(GDataXMLElement*)rootElement node:(NSString*)nodeStr
{
    NSError *error;
    NSArray *array = [rootElement nodesForXPath:nodeStr error:&error];
    if([array count])
    {
        return [array lastObject];
    }
    
    return nil;
}
+ (NSString*)GetNodeString:(GDataXMLElement*)root node:(NSString*)nodeStr
{
    NSError *error;
    if(root)
    {       
        NSArray *nodeArray = [root nodesForXPath:nodeStr error:&error];
            //[root elementsForName:nodeStr];//
        return [[nodeArray lastObject] stringValue];
    }
    return nil;
}
@end
